<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:mo="https://gitee.com/aun/Timo">
<head th:replace="/common/template :: header(~{::title},~{::link},~{::style})">
    <link rel="stylesheet" th:href="@{/lib/zTree_v3/css/zTreeStyle/zTreeStyle.css}" type="text/css">
</head>
<body>
<div class="layui-form timo-compile">
    <form th:action="@{/requirement/manage/save}">
        <input type="hidden" name="requirementid" th:if="${requirementinfo}" th:value="${requirementinfo?.id}"/>
        <div class="layui-collapse">
            <div class="layui-colla-item">
                <h2 class="layui-colla-title">需求信息</h2>
                <div class="layui-colla-content layui-show">
                    <div class="layui-form-item">
                        <label class="layui-form-label"  style="width: 100px">需求名称</label>
                        <div class="layui-input-inline " style="width:400px">
                            <input class="layui-input" type="text" name="requirementName" placeholder="请输入需求名称" th:value="${requirementinfo?.requirementName}">
                        </div>
                        <label class="layui-form-label"  style="width: 100px">需求类型</label>
                        <div class="layui-input-inline " style="width:400px">
                            <input type="radio" name="requirementType" value="1" title="BUG" checked><div class="layui-unselect layui-form-radio layui-form-radioed"><i class="layui-anim layui-icon"></i><div>BUG</div></div>
                            <input type="radio" name="requirementType" value="2" title="需求" th:checked="${requirementinfo?.requirementType} eq 2"><div class="layui-unselect layui-form-radio"><i class="layui-anim layui-icon"></i><div>需求</div></div>
                            <input type="radio" name="requirementType" value="3" title="其他" th:checked="${requirementinfo?.requirementType} eq 3"><div class="layui-unselect layui-form-radio"><i class="layui-anim layui-icon"></i><div>其他</div></div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label"  style="width: 100px">需求状态</label>
                        <div class="layui-input-inline " style="width:400px">
                            <input type="radio" name="requirementStat" value="1" title="待处理" checked><div class="layui-unselect layui-form-radio layui-form-radioed"><i class="layui-anim layui-icon"></i><div>待处理</div></div>
                            <input type="radio" name="requirementStat" value="2" title="处理中" th:checked="${requirementinfo?.requirementStat} eq 2"><div class="layui-unselect layui-form-radio"><i class="layui-anim layui-icon"></i><div>处理中</div></div>
                            <input type="radio" name="requirementStat" value="3" title="已完成" th:checked="${requirementinfo?.requirementStat} eq 3"><div class="layui-unselect layui-form-radio"><i class="layui-anim layui-icon"></i><div>已完成</div></div>
                        </div>
                        <label class="layui-form-label"  style="width: 100px">需求描述</label>
                        <div class="layui-input-inline " style="width:400px">
                            <textarea placeholder="请输入需求描述" class="layui-textarea" name="requirementDescription" id="requirementDescription">[[${requirementinfo?.requirementDescription}]]</textarea>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label" style="width: 100px">预计完成日期</label>
                        <div class="layui-input-inline " style="width:400px">
                            <input class="layui-input" type="text" name="expectedCompletionTime" id="expectedCompletionTime" placeholder="请输入预计完成日期" th:value="${requirementinfo?.expectedCompletionTime}">
                        </div>
                        <label class="layui-form-label" style="width: 100px">实际完成日期</label>
                        <div class="layui-input-inline " style="width:400px">
                            <input class="layui-input" type="text" name="actualCompletionTime"  id="actualCompletionTime" placeholder="请输入实际完成日期" th:value="${requirementinfo?.actualCompletionTime}">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label"  style="width: 100px">备注</label>
                        <div class="layui-input-inline " style="width:400px">
                            <textarea placeholder="请输入备注" class="layui-textarea" name="remark" id="remark">[[${requirementinfo?.remark}]]</textarea>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">上传图片</label>
                        <div class="layui-input-inline">
                            <button type="button" class="layui-btn upload-image" name="image[]"
                                    th:attr="up-url=@{/upload/image}" up-field="path">
                                <i class="layui-icon">&#xe67c;</i>上传图片
                            </button>
                        </div>
                        <div class="upload-show">
                            <div th:if="${imageshow==1}" class="upload-item succeed"  th:each="image : ${imageList}">
                                <img th:src="@{'/requirement/manage/picture?p='+${image}}">
                                <input id="xx" type="hidden" name="image[]" th:value="${image}">
                                <i class="upload-item-close layui-icon layui-icon-close"></i>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-form-item timo-finally">
            <button class="layui-btn ajax-submit"><i class="fa fa-check-circle"></i> 保存</button>
            <button class="layui-btn btn-secondary close-popup"><i class="fa fa-times-circle"></i> 关闭</button>
        </div>
    </form>
</div>
<script th:replace="/common/template :: script"></script>
<script type="text/javascript" th:src="@{/js/plugins/jquery-2.2.4.min.js}"></script>
<script type="text/javascript" th:src="@{/lib/zTree_v3/js/jquery.ztree.core.min.js}"></script>
<script type="text/javascript" th:src="@{/js/timoTree.js}"></script>
<script type="text/javascript">
    $( document ).ready(function() {
        // console.log( "ready!" );
        // $("#sysjclist").find("textarea").hide();
        // $("#yxjclist").find("textarea").hide();
        // $("#mxjylist").find("textarea").hide();
        // $("#xcgjcjg").show();
        // $("#xxyxjg").show();
        // $("#mxjc").show();
    });

    // 树形菜单
    $.fn.selectTree();
    //使用日期控件
    layui.use(['element', 'laydate', 'form'], function () {
        var $ = layui.jquery;
        var form = layui.form;
        var laydate = layui.laydate;

        var build = $(".build-panel");

        //初始化laydate实例
        laydate.render({
            elem: '#expectedCompletionTime'
        });
        laydate.render({
            elem: '#actualCompletionTime'
        });
        // laydate.render({
        //     elem: '#cyrq'
        // });
        // laydate.render({
        //     elem:'#qdtyxzlsj'
        // });
        // laydate.render({
        //     elem:'#zdsj'
        // });
        // laydate.render({
        //     elem:'#scfbsj'
        // });
        // laydate.render({
        //     elem:'#scjysj'
        // });

        // form.on('radio(ChoiceRadio)', function(data){
        //     console.log(data.elem); //得到 radio 原始 DOM 对象
        //     console.log(data.value); //被点击的 radio 的 value 值
        // });
        // form.on('select(sysjc)', function(data) {
        //     $("#sysjclist").find("textarea").hide();
        //     if (data.value == 1) {
        //         $("#xcgjcjg").show()
        //     } else if(data.value==2) {
        //         $("#ncgjcjg").show()
        //     }else if(data.value==3) {
        //         $("#xxhjcjg").show()
        //     }else if(data.value==4) {
        //         $("#bljcjg").show()
        //     }else if(data.value==5) {
        //         $("#jyjcjg").show()
        //     }else if(data.value==6) {
        //         $("#qtjcjg").show()
        //     }
        // });

        // form.on('select(yxjcjg)', function(data) {
        //     $("#yxjclist").find("textarea").hide();
        //     if (data.value == 1) {
        //         $("#xxyxjg").show();
        //     } else if(data.value==2) {
        //         $("#bcyxjg").show()
        //     }else if(data.value==3) {
        //         $("#ctyxjg").show()
        //     }else if(data.value==4) {
        //         $("#hcyxjg").show()
        //     }else if(data.value==5) {
        //         $("#qtyxjg").show()
        //     }
        // });
        //
        // form.on('select(mxjy)', function(data) {
        //     $("#mxjylist").find("textarea").hide();
        //     if (data.value == 1) {
        //         $("#mxjc").show();
        //     } else if(data.value==2) {
        //         $("#jyjc").show()
        //     }
        // });
    });

</script>
</body>
</html>


<!--        <div class="layui-form-item" th:if="!${user}">-->
<!--            <label class="layui-form-label required">用户密码</label>-->
<!--            <div class="layui-input-inline">-->
<!--                <input class="layui-input" type="password" name="password" placeholder="请输入用户密码">-->
<!--            </div>-->
<!--        </div>-->
<!--        <div class="layui-form-item" th:if="!${user}">-->
<!--            <label class="layui-form-label required">确认密码</label>-->
<!--            <div class="layui-input-inline">-->
<!--                <input class="layui-input" type="password" name="confirm" placeholder="再一次输入密码">-->
<!--            </div>-->
<!--        </div>-->
<!--        <div class="layui-form-item">-->
<!--            <label class="layui-form-label required">所在部门</label>-->
<!--            <div class="layui-input-inline">-->
<!--                <input class="layui-input select-tree" th:attr="data-url=@{/system/dept/list}, data-value=${user?.dept?.id}"-->
<!--                       type="text" name="dept"  placeholder="请选择所在部门" th:value="${user?.dept?.title}">-->
<!--            </div>-->
<!--        </div>-->